from django.db import models

# 添加证书的可选择项目
class Liscense_name(models.Model):
    name = models.CharField(max_length=64)

    def __str__(self):
        return self.name

class Liscense_level(models.Model):
    level = models.CharField(max_length=16)

    def __str__(self):
        return self.level

class Liscense_organ(models.Model):
    organ = models.CharField(max_length=64)

    def __str__(self):
        return self.organ


# 添加成员相关的可选择项目
class Company(models.Model):
    c_shortname = models.CharField(max_length=16, blank=True, null=True)
    c_name = models.CharField(max_length=32, blank=True, null=True)

    def __str__(self):
        return self.c_name

class Role(models.Model):
    role = models.CharField(max_length=128)

    def __str__(self):
        return self.role

# 大修轮次
class Outage(models.Model):
    outage = models.CharField(max_length=32, unique=True)
    start_date = models.DateField()
    end_date = models.DateField()
    create_date = models.DateField(auto_now_add=True)

    def __str__(self):
        return self.outage

# 大修项目名称
class Team(models.Model):
    name = models.CharField(max_length=64)

    def __str__(self):
        return self.name

# 事件大类
class Feedback_type(models.Model):
    type = models.CharField(max_length=32)

    def __str__(self):
        return self.type

# 失效原因分类
class Fail_type(models.Model):
    type = models.CharField(max_length=32)

    def __str__(self):
        return self.type

# 事件后果分类
class Result_type(models.Model):
    type = models.CharField(max_length=32)

    def __str__(self):
        return self.type

# 事件定性
class Event_character(models.Model):
    character = models.CharField(max_length=32)

    def __str__(self):
        return self.character

# 部门
class Department(models.Model):
    name = models.CharField(max_length=32)

    def __str__(self):
        return self.name

# 核电基地
class Basement(models.Model):
    full_name = models.CharField(max_length=32)
    short_name = models.CharField(max_length=16)

    def __str__(self):
        return self.short_name

# 机组号
class Unit(models.Model):
    u_num = models.IntegerField()

    def __str__(self):
        return str(self.u_num)



